Introduction
This chapter describes some characteristics of light, and how to use these characteristics in RenderBoy. Although lighting is controlled using techniques described in the next chapter, the theory behind how the light works is presented in this chapter.  In short, this chapter teaches the what, and the next chapter teaches the how. Both are important. You should be familiar with the information covered in the "Image Preparation" chapter before proceeding.

Background Light
What RenderBoy refers to as "background light" can be divided into two types: "ambient light" and "directed light". Ambient light can be thought of as light which is simultaneously traveling in every direction. As a result, it will illuminate all of an object's surfaces by the same amount. If only ambient light existed in the real world, we would have a very difficult time seeing, since all evenly colored objects would be seen as ambiguous uniform shapes of color. Fortunately we are also surrounded by directed light, that is, light which comes from a common direction. Although directed light does not create shadows, it will add illumination to surfaces which face the light.

Our brains are very good at interpreting these variations in illumination as the three dimensional contours of a surface. A very familiar example of directed light is that caused by the sun on a cloudy day. It illuminates the tops of objects, yet does not create shadows. In real life, directed light usually comes from above. The next chapter describes how to change the amount of ambient light, as well as the amount and direction of the directed light. 

Background Gradient
When you render an image, you either see objects which you have created or you see "the background", which is a specific color. In real life, our daytime background is a blue sky. In general, the brightness of the sky varies depending on which direction you are looking. The extent to which the background's brightness changes is called its "gradient".  RenderBoy adjusts the background color so that the brightest portion is in the direction that the directed light is coming from. Likewise, the darkest portion is in the opposite direction. The strength of the background gradient determines how dark the darkest portion can become. When the gradient is set at maximum, the darkest portion of the background is black. When the gradient is at a minimum, the entire background is one uniform color. The next chapter describes how to change the amount of background gradient, as well as the direction of the directed light which orients the gradient. 

Light Source Objects
Another method of illuminating your design is with light source objects. These objects are like any other 3D objects in that you can independently change their color, location, texture, size, etc. In addition, you can adjust the intensity of the light which they emit. If they are visible within the rendered view,  they will be visible like any other object. In nearly every respect they behave exactly like a light bulb, radiating light outward from their center. They will illuminate surfaces which are directly visible to the light, and they will have no effect on surfaces which face away from the light. They can cause shadows to be cast onto other objects, and they can cause spectral reflections (glinty spots) to appear on objects which are shiny. Light source objects can be created and manipulated using the techniques described in the "Object Manipulation" chapter.

Lighting Recommendations
There are many different ways you can manipulate the ambient light, directed light, and object light sources in your designs.  This section just provides some general tips on how you may want to use these features.

While you are creating your initial design, you may want to leave out light source objects altogether.  At this stage you are usually concentrating on getting the geometry right, and more light sources will increase the time of any test renderings you do.  Once the geometry is right, then concentrate on the lighting.

When you add light source objects, you should usually reduce the amount of ambient and directed light in order to increase relative visual impact of the light source objects. A light source object is like a lamp in a room. If the room is already brightly lit, the lamp cannot make the room much brighter, and you won't really see it's affects.

Nothing improves the realism of a rendering more than a couple well placed light sources. Since the light sources create the shadows, glinty spots, and illumination that we are used to seeing in everyday life, any image which contains these effects will come much closer to looking real. This is especially true if you position the lights so they creates interesting shadows and spectral reflections. Even one properly positioned light source object can make an image look like a photograph instead of a cartoon. Refer to the images bundled with RenderBoy for an example of the realism which correctly placed light sources can produce.  This will also be demonstrated in the next chapter.